package com.cq.hd.order.controller;

import com.alibaba.fastjson.JSONObject;
import com.cq.hd.order.api.pft.PftOrderCallBackParam;
import com.cq.hd.order.api.pft.PftOrderTicketParam;
import com.cq.hd.order.service.PftService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "权限认证相关接口")
@Slf4j
@RestController
@RequestMapping("/auth")
public class AuthController {

    @Autowired
    private PftService pftService;

    @GetMapping("/401")
    public Object page401() {
        //return pftService.orderSubmit();
        return pftService.orderPreCheck("3270144","155243","5050841");
        //return pftService.getTicketList();
        //return pftService.OrderChangePro("70671116210575");
        //return pftService.getScenicSpotList();
        //pftService.OrderQuery();
    }

    @PostMapping("/pftOrderCallbck")
    public Object pftOrderCallbckPost(@RequestBody PftOrderCallBackParam param) {
        pftService.checkVerifyCode(param.getVerifyCode());
        log.error(JSONObject.toJSONString(param));
        return "200";
    }

    @GetMapping("/pftOrderCallbck")
    public Object pftOrderCallbckGet() {
        return "success";
    }

    @PostMapping("/pftOrderTicket")
    public Object pftOrderTicketPost(@RequestBody PftOrderTicketParam param) {
        log.error(JSONObject.toJSONString(param));
        return "200";
    }

    @GetMapping("/pftOrderTicket")
    public Object pftOrderTicketGet() {
        return "success";
    }
}
